package com.scnlf.scnlf.portal.core.common.entity;

import java.io.Serializable;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

@Data
@MappedSuperclass
public abstract class IdEntity implements Serializable {

    /**
     * 全局唯一ID，由 SnowflakeIdGenerator 自动生成
     */
    @Id
    @GenericGenerator(name = "snowflake-id", strategy = "com.scnlf.scnlf.portal.core.common.utils.IdGenerator")
    @GeneratedValue(generator = "snowflake-id")
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}